package com.mallcloud.mall.mall.api.entity;


import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.mallcloud.mall.common.core.model.BaseModel;
import com.mallcloud.mall.common.core.util.ValidGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import java.math.BigDecimal;

@ApiModel(value = "MallUserAddrModel",description = "用户地址")
@Data
@TableName(value = "SYS_USER_ADDR", autoResultMap = true)
public class MallUserAddrModel extends BaseModel {
    private static final long serialVersionUID = 1L;

	@JsonSerialize(using = ToStringSerializer.class)
	@NotNull(message = "ID为空", groups = {ValidGroup.Update.class})
    @TableId(type = IdType.ASSIGN_ID)
    @ApiModelProperty(value="ID")
    private Long addrId;

    @ApiModelProperty(value="用户ID")
    private Long userId;

    @ApiModelProperty(value="手机")
    private String mobile;

    @ApiModelProperty(value="是否默认地址 1是")
    private Integer isDefault;

    @ApiModelProperty(value="收货人")
    private String consignee;

    @ApiModelProperty(value="省ID")
    private Long provinceId;

    @ApiModelProperty(value="省")
    private String province;

    @ApiModelProperty(value="城市ID")
    private Long cityId;

    @ApiModelProperty(value="城市")
    private String city;

    @ApiModelProperty(value="区ID")
    private Long areaId;

    @ApiModelProperty(value="区")
    private String area;

    @ApiModelProperty(value="邮编")
    private String postCode;

    @ApiModelProperty(value="地址")
    private String addr;

    @ApiModelProperty(value="经度")
    private BigDecimal lng;

    @ApiModelProperty(value="纬度")
    private BigDecimal lat;

}
